<template>
  <div class="rightFormTable">
    <taskList
      v-if="isShow"
      ref="taskList"
      :fields="fields"
      :search-show="searchShow"
      :params="params"
    />
  </div>
</template>

<script>
import taskList from '@/views/taskUi/baseTask/taskList/index'
import { rightFormTableColumn } from '@/views/taskUi/baseTask/columnData/rightFormTableColumn'
export default {
  name: 'RightFormTable',
  components: {
    taskList
  },
  data() {
    return {
      fields: rightFormTableColumn,
      searchShow: false,
      params: {
        attrType: 'task_type',
        typeCode: ''
      },
      row: {},
      isShow: false
    }
  },
  computed: {
    // isShow () {
    //   return !this.row.isAdd || this.params.typeCode
    // }
  },
  methods: {
    setData(val) {
      console.log(val)
      if (!val) {
        return
      }
      this.row = val
      if (Object.keys(this.row).length === 0) {
        this.isShow = false
      } else {
        this.isShow = !this.row.isAdd
      }
      if (!val.isAdd) {
        const params = { typeCode: val.nodeId ? val.nodeId : '' }
        this.params = Object.assign(this.params, params)
        this.$refs.taskList && this.$refs.taskList.refreshFun()
      }
    }
  }
}
</script>

<style lang="less" scoped>
.rightFormTable {
  width: 100%;
  height: calc(100% - 40px - 242px - 28px - 40px - 20px);
  padding-top: 10px;
}
</style>
